<?php

/**
 * contacte form.
 *
 * @package    e-DSL
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class contacteForm extends BasecontacteForm
{
  public function configure()
  {
  	unset($this['owner_id']);
  }
  
  public function prepareToAssign(){
  	$objDef = new objectDef('contacte');
  	$user = sfContext::getInstance()->getUser()->getUserProfile();
  	foreach($objDef->attributes as $fieldName => $att){
		if($fieldName=='owner'){
			$objDef->attributes[$fieldName]['show']=true;
			$this->setMyWidget($fieldName, $filter = 'commercial_id = ' . $user->id, $options = null, $default = null, $objDef);
		}elseif($fieldName=='fonction'){
		
  		}else{
			$this->hideWidget($fieldName);
		}
	}
  }
}
